package cn.hct.springboot_pro.dao;

import cn.hct.springboot_pro.entity.Item;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface ItemMapper {

    int addItem(@Param("item_name")String item_name,@Param("user_id")int user_id,@Param("type")String type,@Param("price")int price,@Param("introduction")String introduction,@Param("image")String image,@Param("publish_time")String publish_time);

    List<Item> getAllItemOnTime();

    Item getItemById(@Param("item_id")int item_id);

    int updateIStateByid(@Param("item_id")int item_id,@Param("item_state")int item_state);

    List<Item> getItemByType(@Param("type")String type);

    List<Item> getItemByUid(@Param("user_id")int user_id);

    List<Item>  searchLikeItem(@Param("item_name")String item_name);

    List<Item> searchLikeItemPage(@Param("item_name")String item_name,@Param("pageNo")int pageNo,@Param("pageSize")int pageSize);

    List<Item> getItem();

    int updateItem(Item item);

    int deleteItemById(@Param("item_id")int item_id);
}
